import os
import csv

base_dir = ''      #原始文件夹
output_csv = ''      #保存的csv路径
multi_dirs = []

for dir in os.listdir(base_dir):
    dir_path = os.path.join(base_dir, dir)
    if len(os.listdir(dir_path)) > 1:
        multi_dirs.append(dir_path)

with open(output_csv, "w", newline="", encoding="utf-8") as f:
    writer = csv.writer(f)
    writer.writerow(["FolderPath"])
    for folder in multi_dirs:
        writer.writerow([folder])